<body>
	<form name="myform" id="myform" action="/Goods/add/"
		onsubmit="return goods_submit()" method="post">
		<div class="common-form">
			<table width="100%" class="table_form contentWrap">
				<tr>
					<th width="200"><strong>所属分类：</strong></th>
					<td><select name="cid" id="cid" style="width: 200px;">
							<option value="0">请选择分类</option>
							<?php echo $select_categorys ?>
					</select></td>
				</tr>
				<tr>
					<th width="200"><strong>品牌分类：</strong></th>
					<td><select name="brand_cate" id="brand_cate"
						style="width: 200px;">
							<option value="0">请选择分类</option>
							<?php echo $brand_categorys ?>
					</select><select name="basic_cate" id="basic_cate" style="width: 200px;">
							<option value="0">请选择分类</option>
					</select><select name="bid" id="bid" style="width: 200px;">
							<option value="0">请选择分类</option>
					</select></td>
				</tr>
				<tr>
					<th width="200"><strong>来源：</strong></th>
					<td><select name="sid" id="sid" style="width: 100px;">
							<option value="1">淘宝</option>
							<option value="2">天猫</option>
					</select></td>
				</tr>
				<tr>
					<th width="200"><strong>马甲：</strong></th>
					<td><select name="uid" id="uid" style="width: 100px;">
					<?php
					if(!empty($majia_list)){
					   foreach ($majia_list as $val) { 
					?>
						<option value="<?php echo $val['User']['uid'] ?>"><?php echo $val['User']['nickname'] ?></option>
					<?php } } ?>
					</select></td>
				</tr>
				<tr>
					<th><strong>商品名称：</strong></th>
					<td><input type="text" size="60px" name="title" id="title"
						class="input-text"></td>
				</tr>
				<tr>
					<th><strong>商品图片：</strong></th>
					<td><a href='javascript:void(0);'
						onclick="upload('goods','img');return false;"><img
							style="border: 1px solid #999999; padding: 1px;"
							id="thumb_preview" src="/img/icon/upload-pic.png"></a><input
						type="hidden" size="60px" name="img" id="img" class="input-text"></td>
				</tr>
				<tr id="taobao_tr" style="display: none">
					<th><strong>淘宝图片地址：</strong></th>
					<td id="taobao_pic_url"></td>
				</tr>
				<tr>
					<th><strong>链接地址：</strong></th>
					<td><input type="text" size="60px" name="url" id="url"
						value="http://item.taobao.com/item.htm?id=16028918603"
						class="input-text"><input type="button" value="淘宝API获取数据"
						onclick="GetTaobaoData();" class="button"><font
						color="red">(注：直接替换ID参数就可以获取数据)</font></td>
				</tr>
				<tr>
					<th><strong>颜色：</strong></th>
					<td><input type="text" id="title_color" name="title_color"
						class="input-text"><img src="/img/icon/colour.png"
						title="设置标题颜色" width="15" height="16"
						onclick="colorpicker('color_colorpanel','set_title_color');"
						style="cursor: hand" /><span id="color_colorpanel"
						style="position: absolute;" class="colorpanel"></span></td>
				</tr>
				<tr>
					<th><strong>原价格：</strong></th>
					<td><input type="text" name="old_price" id="old_price"
						class="input-text"></td>
				</tr>
				<tr>
					<th><strong>价格：</strong></th>
					<td><input type="text" name="price" id="price"
						class="input-text"></td>
				</tr>
				<tr>
					<th><strong>小编推荐：</strong></th>
					<td><textarea style="height: 100px; width: 500px;"
							class="inputtext" id="remark" cols="20" rows="2" name="remark"></textarea></td>
				</tr>
				<tr>
					<th><strong>商品详情：</strong></th>
					<td><textarea name="content"
							style="width: 670px; height: 270px; visibility: hidden;"
							id="content"></textarea></td>
				</tr>
				<tr>
					<th><strong>是否显示HOTS：</strong></th>
					<td><input type="radio" name="is_hots" value="1"> 是 <input
						type="radio" name="is_hots" value="0" checked>否</td>
				</tr>
				<tr>
					<th><strong>是否首页显示：</strong></th>
					<td><input type="radio" name="is_index" value="1"> 是 <input
						type="radio" name="is_index" value="0" checked>否</td>
				</tr>
				<tr>
					<th><strong>状态：</strong></th>
					<td><input type="radio" name="status" value="1" checked>
						显示 <input type="radio" name="status" value="0">不显示</td>
				</tr>
			</table>
			<!--table_form_off-->
		</div>
		<div class="bk15"></div>
		<div class="fixed-bottom">
			<div class="fixed-but text-c">
				<div class="button">
					<input value="保存后自动关闭" type="submit" name="dosubmit" class="cu"
						style="width: 145px;" onclick="refersh_window()">
				</div>
				<div class="button">
					<input value="保存并继续发表" type="submit" name="dosubmit_continue"
						class="cu" style="width: 130px;" title="Alt+X"
						onclick="refersh_window()">
				</div>

				<div class="button">
					<input value="关闭(X)" type="button" name="close"
						onclick="refersh_window();close_window();" class="cu"
						style="width: 70px;">
				</div>
			</div>
		</div>
	</form>
</body>
<script type="text/javascript">
	document.title = '添加商品';
	self.moveTo(-4, -4);
	function refersh_window() {
		$.cookie('refersh_time', 1);
	}

	var editor1;

	$(document).ready(function() {
		KindEditor.ready(function(K) {
			editor1 = K.create('textarea[name="content"]', {
				uploadJson : '/js/kindeditor/php/upload_json.php',
				fileManagerJson : '/js/kindeditor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	})
</script>